

#ifndef _APPLED_H
#define _APPLED_H


#include <stdint.h>
#include <string.h>
#include <MSP430G2553.h>

#include "AppInit.h"

#include "../../Library/inc/msp430g2_gpio.h"

#define LedSFlashTime     50     // 50ms



#ifdef __cplusplus
extern "C" {
#endif

// LED 的数量
typedef enum
{
    LED0 = 0x00,
    LED1,
    LED_MAX,

}LED_ChannelDef;


// LED状态枚举
typedef enum
{
    LED_ON = 0,
    LED_OFF,
    LED_FLASH,
    LED_HOLD,

}LED_StDef;



// LED控制块
typedef struct
{
    uint8_t tLedMode;
    //uint8_t tLedNewMode;
    uint32_t tLedTimeCnt;
    uint32_t tLedTimeOut;
    uint16_t tLedPeriod;
    uint16_t tLedDelayCnt;   // LED延时
    uint8_t tLedTime;
    uint8_t tLedState;       //LED硬件状态

}tLEDMode_Def;




void tLED_Init(void);
void tLED_Task(void);
//void tLED_Config(uint8_t LedId, uint8_t OpMode, uint32_t ulTimeOut, uint16_t usPeriod, uint8_t ucTime);

void tLED_TimeProc(uint32_t usPeriod);
void tLED_Operate(uint8_t LedId, uint8_t LedOpMode);
void tLED_Config(uint8_t LedId, uint8_t OpMode, uint32_t ulTimeOut, uint16_t usPeriod, uint8_t ucTime);


#ifdef __cplusplus
}
#endif


#endif // _APPLED_H


